<?php

namespace App\Imports;

use App\Models\Game;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
//use Maatwebsite\Excel\Concerns\WithMultipleSheets;

class GameImport implements ToModel, WithHeadingRow
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {
        return new Game([
            //
            'code'=>$row["id"],
            'category_id'=>$row["kind"],
            'grade_id'=>$row["level"],
            'name'=>$row["name"]
        ]);
    }
/*
    public function headingRow(): int
    {
        return 1;
    }
    public function sheets(): array
    {
        return [
            new FirstSheetImport()
        ];
    }
*/
}
